home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
010
/
cannon.bas
< prev
next >
Wrap
BASIC Source File
|
1988-11-09
|
2KB
|
69 lines
1000 CLS: PRINT TAB(30);"CANNONEER"
1010 PRINT:PRINT:PRINT
1020 PRINT"You are the commander of a gun crew for a long-range"
1030 PRINT"cannon. You must give your crew the proper angle "
1040 PRINT"of elevation in degrees to put your rounds on the "
1050 PRINT"target. A hit by one of your high explosive rounds "
1060 PRINT"within a hundered meters of the target will destroy it. "
1070 PRINT
1080 SEC = 18.2 'clock ticks to make 1 second used for sound stmt
1090 R=INT(4000*RND(6)+10000)
1100 PRINT"The maximum range of your gun is ";R;" meters."
1110 Z=0
1120 PRINT
1130 S1=0
1140 T=INT(R*(.1+.8*RND(6)))
1150 S=0
1160 GOTO 1370
1170 PRINT"Barrel cannot be depressed below one degree."
1180 GOTO 1400
1190 PRINT"Barrel elevation cannot exceed 89 degrees."
1200 GOTO 1400
1210 PRINT"Forward observer reports round was long by ";ABS(E);" meters."
1220 GOTO 1400
1230 PRINT"Forward observer reports round was short by ";ABS(E);" meters."
1240 GOTO 1400
1250 PRINT"### TARGET DESTROYED### ";S;" rounds fired."
1260 S1=S1+S
1270 IF Z=4 THEN 1580
1280 Z=Z+1
1290 PRINT
1300 FOR J = 1 TO 5
1310 FOR FREQ = 500 TO 3500 STEP 100
1320 SOUND FREQ,.35
1330 NEXT FREQ
1340 NEXT J
1350 PRINT"Forward observer has sighted new activity!!!"
1360 GOTO 1140
1370 PRINT" Range to target is ";T;" meters."
1380 PRINT" Fire for effect!"
1390 PRINT:PRINT
1400 INPUT "Elevation? ",B
1410 IF B>89 THEN 1190
1420 IF B<1 THEN 1170
1430 SOUND 400,.5*SEC
1440 FOR FREQ = 3000 TO 4000 STEP 10
1450 SOUND FREQ, .02*SEC
1460 NEXT FREQ
1470 SOUND 150,.5*SEC
1480 S=S+1
1490 IF S<6 THEN 1540
1500 PRINT
1510 SOUND 100,10
1520 PRINT"BOOM!!! You have just been destroyed by enemy fire."
1530 PRINT:PRINT:PRINT: GOTO 1620
1540 B2=2*B/57.3 : I = R*SIN(B2) : X=T-I : E=INT(X)
1550 IF ABS(E)<100 THEN 1250 'target destroyed
1560 IF E>100 THEN 1230 'round short
1570 GOTO 1210 'over target
1580 PRINT:PRINT:PRINT"Total rounds expended: ";S1
1590 IF S1>18 THEN 1620
1600 PRINT "Nice shooting! There could be a promotion in ths for you."
1610 GOTO 1640
1620 PRINT "The cook can do better! Did you sleep through artillery"
1630 PRINT "school? You need a refresher at Fort Sill."
1640 PRINT: INPUT "Another target? (Y or N)";Z$
1650 IF Z$="Y" OR Z$= "y" THEN 1090
1660 PRINT "You deserve some R&R. See you later."
1670 END